<template>
  <div class="login">
    <!--  底部  -->
    <div class="el-login-footer">
      <span>Copyright © 2019-2023 Sinosoft Co.,Ltd All Rights Reserved.</span>
    </div>
  </div>
</template>
  
<script>

export default {
  name: "Login",
  data() {
    return {
      loading: false,
      loginForm: {
        userId: ""
      },
    };
  },
  watch: {
  },
  mounted() {
    this.init()
  },
  methods: {
    init() {
      let userId = this.$route.query && this.$route.query.userId;
      if (userId) {
        this.loginForm.userId = userId
        this.handleAuthLogin()
      } else {
        this.$modal.msgError("参数错误！");
      }
    },
    handleAuthLogin() {
      this.$modal.loading("认证中，请稍候...");
      this.$store.dispatch("AuthLogin", this.loginForm).then(() => {
        setTimeout(() => {
          this.$modal.closeLoading();
          // this.$router.push({ path: '/work/todo'}).catch(()=>{});
          this.$router.push({ path: this.redirect || "/" }).catch(() => { });
        }, 800);
      }).catch(() => {
        this.$modal.closeLoading();
        // this.$modal.msgError("认证失败！");
      });
    }
  }
};
</script>
  
<style rel="stylesheet/scss" lang="scss" scoped>
.login {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
  background-size: cover;
  background-image: none;
}

.el-login-footer {
  height: 40px;
  line-height: 40px;
  position: fixed;
  bottom: 0;
  width: 100%;
  text-align: center;
  color: #008bf1;
  font-family: Arial;
  font-size: 12px;
  letter-spacing: 1px;
}
</style>
  